<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<link rel="stylesheet" type="text/css" href="${facesContext.externalContext.request.contextPath}/Paginas/CSS/styles.css" />

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<h:panelGrid id="formCadArtistas" columns="2" styleClass="conteudo">


    <h:outputLabel value="Titulo do Album :" />
    <h:inputText id="Titulo_do_Album" size="60" value="#{cadastrosAppCotroller.albumViewHelper.album.nomeDoAlbum}" required="true" />

    <h:panelGroup>
        <h:outputLabel value="Autor:" /><br>
        <h:selectOneListbox id="selectOneListAutor" size="10"  value="#{cadastrosAppCotroller.albumViewHelper.autor}" required="true"  >
            <f:selectItems value="#{cadastrosAppCotroller.albumViewHelper.obterListaDeArtistas}"  />
        </h:selectOneListbox>

    </h:panelGroup>


    <h:panelGroup>
        <h:outputLabel value="Categorias:" /><br>
        <h:selectOneListbox id="selectOneListCategoriaDoAlbum" size="5"  value="#{cadastrosAppCotroller.albumViewHelper.album.codigoDaCategoria}" required="true">
            <f:selectItems value="#{cadastrosAppCotroller.albumViewHelper.listaDeCategoriasFormatadas}"  />
        </h:selectOneListbox>

    </h:panelGroup>

    <h:panelGroup>
        <h:outputLabel value="Numero de Midias:" />
        <h:inputText id="numeroDeCDs" size="3" value="#{cadastrosAppCotroller.albumViewHelper.album.numeroDeCDs}" required="true">
			<f:convertNumber integerOnly="true" maxIntegerDigits="2"/>
        </h:inputText>

    </h:panelGroup>

    <h:panelGroup>
        <h:outputLabel value="Numero de Musicas:" />
        <h:inputText id="numeroDeMusicas" size="3" value="#{cadastrosAppCotroller.albumViewHelper.numeroDeMusicas}" required="true">

        </h:inputText>

    </h:panelGroup>


    <h:commandButton id="cbLimpar" immediate="true" styleClass="botoesMenu" action="#{cadastrosAppCotroller.mostrarCadastroDeAlbums}" value="Limpar" />

    <h:commandButton id="cbEnviar" styleClass="botoesMenu" action="#{cadastrosAppCotroller.cadastrarAlbum}" value="Cadastrar" />


</h:panelGrid>